/**
 ******************************************************************************
 * @file    assi.h
 * @author  hyseim software Team
 * @date    18-Aug-2023
 * @brief   This file provides all the headers of the assi functions.
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2020 Hyseim. Co., Ltd.
 * All rights reserved.
 *
 * This software is licensed under terms that can be found in the LICENSE file
 * in the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 *
 ******************************************************************************
 */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __ASSI_H__
#define __ASSI_H__

#include "chip_define.h"
#include "typedefine.h"
#include "utils.h"

#ifdef __cplusplus
extern "C" {
#endif

#define ASSI_MODE_I2C       1
#define ASSI_MODE_UART      2
#define ASSI_MODE_SIR       3 //UART SIR MODE
#define ASSI_MODE_MSPI3     4
#define ASSI_MODE_MSPI4     (5 | BIT(3) | BIT(4))  //BIT(3) | BIT(4) Multiple main competing bits, a single host must be set to one, configured as one through these two bits
#define ASSI_MODE_SSPI      6

#define ASSI(x)    ASSI##x##_BASE

typedef struct {
    volatile uint32_t mode;
    union {
        volatile uint32_t lin;
        volatile uint8_t reserved0[0xFC];
    };
    union {
        volatile uint32_t uart;
        volatile uint8_t reserved1[0x100];
    };
    union {
        volatile uint32_t i2c;
        volatile uint8_t reserved2[0x100];
    };
    union {
        volatile uint32_t mspi;
        volatile uint8_t reserved3[0x100];
    };
    union {
        volatile uint32_t sspi;
        volatile uint8_t reserved4[0x100];
    };
} ASSI_t;

int32_t ASSI_Init(void *base);
int32_t ASSI_DeInit(void *base);
#ifdef __cplusplus
}
#endif

#endif